package doantotnghiep.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "ChiTietXuatHang")
public class ExportedDetail {
	
	private int id; 
	private ExportedMedicine exportedMedicine;
	private Medicament medicament;
	private int totalBatch;
	private float exportCost;
	
	@Column(name= "ThanhTien")
	public float getOrderCost() {
		return exportCost;
	}

	public void setOrderCost(float orderCost) {
		this.exportCost = orderCost;
	}

	@Id
	@GeneratedValue
	@Column(name = "MaCTXH")
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	@Column(name="SoLuong")
	public int getTotalBatch() {
		return totalBatch;
	}
	
	public void setTotalBatch(int totalBatch) {
		this.totalBatch = totalBatch;
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "MaSP")
	public Medicament getMedicament() {
		return medicament;
	}
	
	public void setMedicament(Medicament medicament) {
		this.medicament = medicament;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MaPXH")
	public ExportedMedicine getExportedMedicine() {
		return exportedMedicine;
	}

	public void setExportedMedicine(ExportedMedicine exportedMedicine) {
		this.exportedMedicine = exportedMedicine;
	}
	
	
}
